package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.AutoFill;
import com.ruoyi.common.enums.AutoFillType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DispatchConfigurationMapper;
import com.ruoyi.system.domain.DispatchConfiguration;
import com.ruoyi.system.service.IDispatchConfigurationService;

/**
 * 组态工艺Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@Service
public class DispatchConfigurationServiceImpl implements IDispatchConfigurationService 
{
    @Autowired
    private DispatchConfigurationMapper dispatchConfigurationMapper;

    /**
     * 查询组态工艺
     * 
     * @param configurationId 组态工艺主键
     * @return 组态工艺
     */
    @Override
    public DispatchConfiguration selectDispatchConfigurationByConfigurationId(Long configurationId)
    {
        return dispatchConfigurationMapper.selectDispatchConfigurationByConfigurationId(configurationId);
    }

    /**
     * 查询组态工艺列表
     * 
     * @param dispatchConfiguration 组态工艺
     * @return 组态工艺
     */
    @Override
    public List<DispatchConfiguration> selectDispatchConfigurationList(DispatchConfiguration dispatchConfiguration)
    {
        return dispatchConfigurationMapper.selectDispatchConfigurationList(dispatchConfiguration);
    }

    /**
     * 新增组态工艺
     * 
     * @param dispatchConfiguration 组态工艺
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.INSERT)
    @Override
    public int insertDispatchConfiguration(DispatchConfiguration dispatchConfiguration)
    {
        return dispatchConfigurationMapper.insertDispatchConfiguration(dispatchConfiguration);
    }

    /**
     * 修改组态工艺
     * 
     * @param dispatchConfiguration 组态工艺
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.INSERT)
    @Override
    public int updateDispatchConfiguration(DispatchConfiguration dispatchConfiguration)
    {
        return dispatchConfigurationMapper.updateDispatchConfiguration(dispatchConfiguration);
    }

    /**
     * 批量删除组态工艺
     * 
     * @param configurationIds 需要删除的组态工艺主键
     * @return 结果
     */
    @AutoFill(operation = AutoFillType.UPDATE)
    @Override
    public int deleteDispatchConfigurationByConfigurationIds(Long[] configurationIds)
    {
        return dispatchConfigurationMapper.deleteDispatchConfigurationByConfigurationIds(configurationIds);
    }

    /**
     * 删除组态工艺信息
     * 
     * @param configurationId 组态工艺主键
     * @return 结果
     */
    @Override
    public int deleteDispatchConfigurationByConfigurationId(Long configurationId)
    {
        return dispatchConfigurationMapper.deleteDispatchConfigurationByConfigurationId(configurationId);
    }
}
